<script setup>

import {ref} from "vue";
import Editor from "../components/editor/Editor.vue";

let value = ref("");
let editor = ref(null);

let demo = () => {
  editor.value.setValue(JSON.stringify(JSON.parse(value.value), undefined, 2))
}

</script>

<template>
  <editor ref="editor" v-model="value" mode="text/x-yaml"/>
  <el-button @click="demo">保存</el-button>
</template>
